import Foundation

public class ArrayQueue {
    var items: [Int]
    var n: Int = 0
    var head: Int = 0
    var tail: Int = 0
    
    public init(capacity: Int) {
        self.items = [Int]()
        self.n = capacity
    }
    
    public func enqueue(_ item: Int) -> Bool {
        //队列已满
        if self.tail == self.n {
            return false
        }
        self.items.append(item)
        return true
    }
}

